package com.stylefeng.guns.modular.system.warpper;

import java.text.DecimalFormat;
import java.util.Map;

import com.stylefeng.guns.core.base.warpper.BaseControllerWarpper;

public class GnGpcWarpper extends BaseControllerWarpper{

	public GnGpcWarpper(Object list) {
        super(list);
    }

    @Override
    public void warpTheMap(Map<String, Object> map) {
    	DecimalFormat df = new DecimalFormat("0.00");
		
    	map.put("ZLCB", df.format((Double)map.get("ZLCB")));
    	map.put("gZsz", df.format(Math.abs(((Double)map.get("gZsz") / 100000000))));
    	
    	Double gQjzdf = (Double)map.get("gJqZdf");
		map.put("gJqZdf", (gQjzdf >0 ? "<font color='red'><b>"+df.format(gQjzdf)+"</b></font>" : "<font color='green'><b>"+df.format(gQjzdf)+"</b></font>"));
		
    	String JGCYDType = ((String)map.get("JGCYDType"));
    	String font = "";
		if(JGCYDType.equals("不控盘")){
			font = "<font color='DimGray'><b>不控盘</b></font>";
		}else if(JGCYDType.equals("轻度控盘")){
			font = "<font color='BurlyWood'><b>轻度控盘</b></font>";
		}else if(JGCYDType.equals("中度控盘")){
			font = "<font color='Chocolate'><b>中度控盘</b></font>";
		}else{
			font = "<font color='Brown'><b>完全控盘</b></font>";
		}
		map.put("JGCYDType", font);
    }
    
}
